#ifndef _DOMINO_H_
#define _DOMINO_H_


#include <stdlib.h>
#include <stdio.h>
#include <GL/glut.h>
#include <math.h>
#include <gl\gl.h>			// Header File For The OpenGL32 Library
#include <gl\glu.h>			// Header File For The GLu32 Library
#include <gl\glaux.h>		// Header File For The Glaux Library

const double PI = 3.14159265;
const double DEGTORAD = PI/180;

class Domino
{
protected:
    //tamanho do domino
    GLfloat base;
    GLfloat height;
    //Qual textura e quantas tem
    int texture, texturemax;
    //posicao do domino
    GLfloat x_rot, y_rot, z_rot;
    GLfloat x_spc, y_spc, z_spc;
    //Angulos maximo e minimo de um domino
    GLfloat z_rot_max, z_rot_min;
    //Flag de cair
    bool falling;
    //Velocidade de queda
    GLfloat fall_speed;
    
public:
    //Construtor
    Domino::Domino(GLfloat base, GLfloat height, int texture, int texturemax, GLfloat x_spc, GLfloat y_spc, GLfloat z_spc, GLfloat x_rot, GLfloat y_rot, GLfloat z_rot);
    //Destrutor
    ~Domino();
    
    //Pegar o angulo no eixo X em radianos
    GLfloat GET_x_angle(int rad);
    //Pegar o angulo no eixo Z
    GLfloat GET_z_angle(int rad);
    //Pegar qual a textura do domino
    int GET_texture();
    //Virar domino
    void ADD_z_angle(GLfloat angle);
    
    //Muda a textura
    void SET_texture();
    
    //Fazer o domino cair
    void DominoFall();
    //Resetar a posicao dos dominos
    void DominoReset();
    //Acelera a queda
    void ADD_fall_speed(GLfloat add);
    
    //Desenhar o domino
    void DrawDomino(GLUquadricObj *quadratic, GLuint tex[4][3]);
    
};

#endif /*_DOMINO_H_*/
